#include "wuSolidShapeManager.h"

wuSolidShapeManager::wuSolidShapeManager()
{

}

wuSolidShapeManager::~wuSolidShapeManager()
{
}

void wuSolidShapeManager::capture(ofImage *currImg, ofImage *bgImg, int x_offset)
{
	if(!bBypass)
	{
		for (int i = 0; i < shapes.size(); i++)
			shapes[i].clear();
		shapes.clear();

		wuBase2dManager::capture(currImg, bgImg, x_offset);
	}
}

void wuSolidShapeManager::addBitxo(ofImage *_skin, ofRectangle rect, vector <ofPoint> * _pts)
{
    ofRectangle _sel;

    _sel = selection;
    _sel.x = selection.x + x_scroll;
	wuSolidShape shape;
	if(selection.height<vh && selection.width<vw)
        shape.setup(box2d, rect, _pts, _sel);
	else
        shape.setup(box2d, rect, _pts);
	shapes.push_back(shape);
}

void wuSolidShapeManager::draw(bool bDrawlines, int offX)
{
	if(!bBypass)
	{
        for (int i = 0; i < shapes.size(); i++)
            shapes[i].draw(bDrawlines, offX);
	}
}

void wuSolidShapeManager::clear()
{
    for (int i = 0; i < shapes.size(); i++)
		shapes[i].clear();
	shapes.clear();
}

